﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using static Model.AdminInfo;

namespace TakeoutMangesWeb
{
    public partial class AdminLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

      
        protected void Button1_Click1(object sender, EventArgs e)
        {
            string name = txtname.Value.Trim();
            string pwd = txtpwd.Value.Trim();
            Admininfo u = TakeoutMangesBLL.AdminInfoBLL.Login(name, pwd);
            if (u != null)
            {
                Session["name"] = name;
                Response.Redirect("AdminterIndex.aspx");
            }
            else
            {
                Response.Write("<script>alert('用户名或密码错误，请重新输入！');</script>");
            }
        }
    }
}